﻿@using QDT.Common
@using QDT.Core
@using QDT.Core.Assignments
@using QDT.Core.Projects
@using QDT.Web
@model QDT.Core.Assignments.Assignment
@{
    ViewBag.Title = "债权转让详情";
    Project project = Html.F().GetProject(Model.ProjectId);
    var days = (project.RepayEndTime.Value.Date - DateTime.Now.Date).Days;
}   
    

<div id="jm-touch" class="app-link-displaying">
<div id="jm-creditassign-detail">
    <div class="creditassign-c">
     
        <div class="creditassign-wall">
            <div class="top col">
                <div><a href="@Url.Action("ProjectDetail", "Home", new {id = project.ID})" target="_blank" class="emphasize 

title">@project.Name</a><span class="number">债权转让项目 EAD<span>@Model.ID.ToString("0000")</span></span></div>
                <div>
                    @if (Model.Status == AssignmentStatus.Cancel)
                    {
                        <span class="progress">已结束</span>
                    }
                    @if (Model.Status == AssignmentStatus.Completed)
                    {
                        <span class="progress">已卖出</span>
                    }
                    @if (Model.Status == AssignmentStatus.Progress)
                    {
                        if (Model.EndTime <= DateTime.Now)
                        {
                            <span class="progress">已结束</span>
                        }
                        else
                        {
                            <span class="progress">
                                进行中</span>
                        }
                    }
                    <span class="creditassign-icon">$ 债权转让</span>
                </div>
            </div>
            <div class="col">
                <div class="row">
                    <label>原始项目</label>
                    <span>@project.Name</span><i class="icon-info-sign icon-gray"></i></div>
                   
            </div>
            <div class="col">
                <div class="row">
                    <label>原债权人</label>
                    <span>@(Html.F().GetUserName(Model.UserId).ToConfuse(1, 1, 3))</span><i class="icon-info-sign icon-gray"></i>
                </div>
            </div>
            <div class="col">
                <div class="row">
                    <label>债权总价</label>
                    <span>@Model.Money.ToMoney()</span><i class="icon-info-sign icon-gray"></i>
                </div>
            </div>
           
            <div class="col">
                <div class="row">
                    <label>转让价格</label>
                    <span>@Model.BuyAmount.ToMoney()</span><i class="icon-info-sign icon-gray"></i>
                </div>
            </div>
           
        
            <div class="col">
                <div class="row">
                    <label>原标年化</label>
                    <span>@project.Rate.00%</span><i class="icon-info-sign icon-gray"></i></div>
                <div class="row">
                    <label>到期日期</label>
                    <span>@((project.RepayEndTime.Value).ToString("yyyy年MM月dd日"))</span></div>
            </div>
            <div class="col">
                <div class="row">
                    <label>剩余时间</label>
                    <span>@(days < 0 ? 0 : days)</span></div>
                <div class="row">
                    <label>折让率</label>
                    <span>@Model.DiscountRate<span>.00%</span></span></div>
            </div>
            <div class="col">
                <div class="row">
                    <label>还款方式</label>
                    <span>付息还本</span></div>
                <div class="row">
                    <label>保障方式</label>
                    <span>本金 + 利息</span></div>
            </div>
 
        </div>
    </div>
</div>
</div>